{include file="public/header"}
<body>
<style>
    .layui-form-label{
        width: 200px;
    }
    .layui-input{
        width:70%;
    }
</style>

<form class="layui-form" action="">
    <input type="hidden" name="edit_id" value="{$list['id']}">
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 上级代理商名称</label>
        <div class="layui-input-block">
            <input type="text" value="{$uper_name}" readonly class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 代理商名称</label>
        <div class="layui-input-block">
            <input type="text" name="name" required value="{$list['name']}" lay-verify="required" placeholder="代理商名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 手机号</label>
        <div class="layui-input-block">
            <input type="text" name="mobile" required value="{$list['mobile']}" lay-verify="phone" placeholder="必须是11位手机号码" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 银行卡号</label>
        <div class="layui-input-block">
            <input type="text" name="card_number" required value="{$list['card_number']}" lay-verify="required" placeholder="请输入银行卡号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 对应银行名称</label>
        <div class="layui-input-block">
            <input type="text" name="card_bank" required value="{$list['card_name']}" lay-verify="required" placeholder="请输入卡号对应的银行名称" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 持卡人姓名</label>
        <div class="layui-input-block">
            <input type="text" name="card_name" required value="{$list['card_name']}" lay-verify="required" placeholder="请输入持卡人姓名" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 身份证号</label>
        <div class="layui-input-block">
            <input type="text" name="id_card" required value="{$list['id_card']}" lay-verify="required" placeholder="请输入身份证号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 绑定手机</label>
        <div class="layui-input-block">
            <input type="text" name="card_mobile" required value="{$list['card_mobile']}" lay-verify="card_mobile" placeholder="银行卡绑定的手机号" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 等级选择</label>
        <div class="layui-input-block">
            <select name="level">
                <option value=""></option>
                <option {if condition="$list['level'] == 0"}selected{/if} value="0">县级代理</option>
                <option {if condition="$list['level'] == 1"}selected{/if} value="1">市级代理</option>
                <option {if condition="$list['level'] == 2"}selected{/if} value="2">省级代理</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"><span style="color:red">*</span> 代理商地址</label>
        <div class="layui-input-block">
            <input type="text" name="address" required value="{$list['address']}" lay-verify="required" placeholder="请输入代理商地址" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="admin-form">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>


{include file="public/footer"}

<script>
    layui.use('form', function(){
        var form = layui.form();
        form.on('submit(admin-form)', function(data){
            var params  = {
                url: '{:url("add")}',
                data: data.field,
                type: 'post',
                sCallback:function(res){
                    layer.msg(res.msg,{time:1800},function(){
                        location.reload();
                    });
                }
            };
            common.request(params);
            return false;
        });

    });
</script>

</body>
</html>